<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Meta Tags -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Page Title -->
    <title> 珠海数渠科技有限公司 </title>

    <!-- Favicon and Touch Icons -->
    <link href="/images/favicon/favicon.png" rel="shortcut icon" type="image/png">
    <link href="/images/favicon/apple-touch-icon.png" rel="apple-touch-icon">
    <link href="/images/favicon/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72">
    <link href="/images/favicon/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114">
    <link href="/images/favicon/apple-touch-icon-144x144.png" rel="apple-touch-icon" sizes="144x144">

    <!-- Icon fonts -->
    <link href="/css/font-awesome.min.css" rel="stylesheet">
    <link href="/css/flaticon.css" rel="stylesheet">

    <!-- Bootstrap core CSS -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">

    <!-- Plugins for this template -->
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/owl.carousel.css" rel="stylesheet">
    <link href="/css/owl.theme.css" rel="stylesheet">
    <link href="/css/slick.css" rel="stylesheet">
    <link href="/css/slick-theme.css" rel="stylesheet">
    <link href="/css/owl.transitions.css" rel="stylesheet">
    <link href="/css/jquery.fancybox.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/css/style/style.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

    <!-- start page-wrapper -->
    <div class="page-wrapper">

        <!-- start preloader -->
        <div class="preloader">
            <div class="inner">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
        <!-- end preloader -->

        <!-- Start header -->
        <header id="header" class="main-header header-style-2">

            <!-- start topbar -->
            <div class="topbar">
                <div class="upper-topbar">
                    <div class="container">
                        <div class="row">
                            <div class="col col-sm-6">
                            </div>
                            <div class="col col-sm-6">
                            </div>
                        </div>
                    </div>
                </div> <!-- end uppertopbar -->

                <div class="lower-topbar">
                    <div class="container">
                        <div class="row">
                            <div class="col col-md-2">
                                <div class="logo-wrapper">
                                    <a class="site-logo" href="#"><img src="/images/logo.png" style="width: 280px;height: 70px;"></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div> <!-- end lower-topbar -->
            </div>
            <!-- end topbar -->


             <!-- start nav -->
            <nav class="navigation navbar navbar-default" style="background-color:#081426;">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="open-btn">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                    </div>
                    <div id="navbar" class="navbar-collapse collapse navigation-holder navbar-left">
                        <button class="close-navbar"><i class="fa fa-close"></i></button>
                        <ul class="nav navbar-nav">
                            <li class="menu-item-has-children">
                                 <a href="/blog">主页</a>
                            </li>
                            <li class="menu-item-has-children">
                                <a href="/blog/service">服务</a>
                                <!-- <ul class="sub-menu">
                                    <li><a href="/blog/service">借贷服务</a></li>
                                    <li><a href="#">...</a></li>
                                </ul> -->
                            </li>
                            <li class="menu-item-has-children">
                                <a href="/blog/product">产品</a>
                            </li>
                            <li class="menu-item-has-children current-menu-ancestor">
                                <a href="/blog/news">新闻</a>
                            </li>
                            <li class="menu-item-has-children"><a href="/blog/company">关于我们</a></li>
                        </ul>
                    </div><!-- end of nav-collapse -->
                </div><!-- end of container -->
            </nav>
            <!-- end nav -->
        </header>
        <!-- end of header -->

        <!-- start case-single-section -->
        <section class="case-single-section section-padding">
            <div class="container">
                <div class="row">
                    <div class="col col-lg-9 col-lg-push-3 col-md-8 col-md-push-4">
                        <div class="case-single-details">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="grid">
                                        <div class="entry-body blog-grids-s2">
                                            <div class="entry-meta">
                                                <ul id="title_desc">
                                                    <li><i class="fa fa-user"></i>Post by: <a href="javascript:void()" id="author"></a></li>
                                                    <li><i class="fa fa-calendar"></i> <a href="javascript:void()" id="post_date"></a></li>
                                                   <!--  <li><i class="fa fa-commenting"></i> <a href="#">5 Comments</a></li> -->
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="case-title">
                                <h2 id="news_title"></h2>
                                <!-- <div class="cat"><a href="#">Groth &amp; strategy</a></div> -->
                            </div>
                            <div class="details">
                                <p id="news_details"></p>
                            </div>
                        </div>
                    </div>

                    <div class="col col-lg-3 col-lg-pull-9 col-md-4 col-md-pull-8">
                        <div class="blog-sidebar">
                            <div class="widget search-widget">
                                <form class="form" id="searchForm">
                                    <div>
                                        <input type="text" class="form-control" id="title" placeholder="Search...">
                                        <button type="button" onclick="bindList($('#title').val())"><i class="fa fa-search"></i></button>
                                    </div>
                                </form>
                            </div>
                            <div class="widget categories-widget">
                                <h3>News Top 10</h3>
                                <ul id="newList">
                                </ul>
                            </div>
                        </div>
                    </div>
                </div> <!-- end row -->
            </div> <!-- end container -->
        </section>
        <!-- end case-single-section -->




        <!-- start footer -->
        <footer class="site-footer">
            <div class="copyright-row">
                <div class="container">
                    <div class="row">
                        <div class="col col-sm-6 col-sm-offset-4">
                            <p>Copyright &copy; 珠海数渠科技有限公司  2018. All rights reserved | <a href="#"><span class="color-y">idol theme</span></a></p>
                        </div>
                    </div>
                </div> <!-- end container -->
            </div> <!-- end copyright-row -->
        </footer>
        <!-- end footer -->
        </div>
    <!-- end of page-wrapper -->



    <!-- All JavaScript files
    ================================================== -->
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>

    <!-- Plugins for this template -->
    <script src="../js/jquery-plugin-collection.js"></script>

    <!-- Custom script for this template -->
    <script src="../js/script.js"></script>
   	<script type="text/javascript">
   		var _newsList;
		$(function(){
			bindList('');
		});

		function bindList(title) {
			$("#newList").empty();
			var _url = '/blog/open/list?limit=10&offset=0';
			if(title&&title.length>0){
				_url+="&title="+title;
			}
			console.log(_url);
			$.ajax({
					url : _url,
					method : 'get',
					dataType : 'json',
					success : function(data) {
						var rows = data.rows;
						_newsList = rows;
						total = data.total;
						var htmlText = "";
						for (i = 0; i < rows.length; i++) {
							//htmlText += '<li title='+Trim(rows[i].title+'|'+rows[i].gtmCreate)+'><a href=javascript:newsDetail("'+rows[i].cid+'")>'+rows[i].title+'</a></li>';
							htmlText += '<li><a href=javascript:newsDetail("'+rows[i].cid+'")>'+rows[i].title+"("+rows[i].gtmCreate+')</a></li>';
						}
						if(htmlText.length==0){
							htmlText="<li><a href='javascript:void(0);'>没有搜索到相关新闻</a></li>";
						}else{
							newsDetail(rows[0].cid);
						}
						$("#newList").append(htmlText);
						
					}
				});
		}
		
		function newsDetail(id){
			for(var i=0;i<_newsList.length;i++){
				if(_newsList[i].cid==id){
					$("#author").text(_newsList[i].author);
					$("#post_date").text(_newsList[i].gtmCreate);
					$("#news_title").text(_newsList[i].title);
					$("#news_details").html(_newsList[i].content);				
				}
			}
		}
		function Trim(str){
			var is_global="g";
            var result;
            result = str.replace(/(^\s+)|(\s+$)/g,"");
            if(is_global.toLowerCase()=="g"){
                result = result.replace(/\s/g,"");
            }
            return result;
		}
	</script>
</body>
</html>

